import React from "react"
import { rootState } from "../../../store"
import styles from "../style.module.scss"
import { connect } from "react-redux"

interface IListProps {
	list: number[]
}

class List extends React.Component<IListProps> {
	render(): React.ReactNode {
		return (
			<div>
				{this.props.list.map(item => (
					<div className="d-flex justify-content-between border-top py-2" key={item}>
						<div className="me-3">
							<h3 className="fs-5">虎哥虎哥虎哥谁打我就按到年底</h3>
							<p>item {item} 虎哥虎哥虎哥谁打我就按到年底外我打我大我我好</p>
						</div>
						<img className={`${styles["list-item-img"]} rounded`} src="https://th.wallhaven.cc/small/8o/8ogod1.jpg" alt="pic" />
					</div>
				))}
			</div>
		)
	}
}

const mapState = (state: rootState) => ({
	list: state.home.articleList,
})

export default connect(mapState)(List)
